from selenium import webdriver
from selenium.webdriver.common.by import By
import time
from pathlib import Path
dl_folder = 'E:\\python_logo'
Path(dl_folder).mkdir(parents=True, exist_ok=True)
chrome_options = webdriver.ChromeOptions()
prefs = {'profile.default_content_settings.popups': 0, 'download.default_directory': dl_folder}
chrome_options.add_experimental_option('prefs', prefs)
browser = webdriver.Chrome(options=chrome_options)
browser.maximize_window()
browser.get('https://www.python.org/community/logos/')
time.sleep(3)
browser.find_element(By.CSS_SELECTOR, '#the-python-logo > ul > li:nth-child(3) > a').click()
